Iterator Types
نویسندگان
چکیده
System L is a linear λ-calculus with numbers and an iterator, which, although imposing linearity restrictions on terms, has all the computational power of Gödel’s System T . System L owes its power to two features: the use of a closed reduction strategy (which permits the construction of an iterator on an open function, but only iterates the function after it becomes closed), and the use of a liberal typing rule for iterators based on iterative types. In this paper, we study these new types, and show how they relate to intersection types. We also give a sound and complete type reconstruction algorithm for System L.
منابع مشابه
Linearity and iterator types for Gödel's System
System LI is a linear λ -calculus with numbers and an iterator, which, although imposing linearity restrictions on terms, has all the computational power of Gödel’s System T . System LI owes its power to two features: the use of a closed reduction strategy (which permits the construction of an iterator on an open function, but only iterates the function after it becomes closed), and the use of ...
متن کاملCharles: A Data Structure Library for Ada95
Associated with each data structure type is a separate iterator type, which allows you to visit each item in the container. In particular, an iterator abstracts away differences in specific container types, allowing you to view the collection simply as a sequence of items. A generic algorithm (for sorting, say) can be written in terms of an iterator, so that you can use the algorithm over any d...
متن کاملType Erasure in C++: The Glue between Object-Ori- ented and Generic Programming
C++ is a multi-paradigm language. The two main paradigms in C++ are object-oriented programming and generic programming. Many real-world C++ software projects use these two paradigms side by side. This creates considerable tension due to the fact that object-oriented programming is largely based on the judicious choice of types and hierarchies, while generic programming tends to cause an abunda...
متن کاملNonfree Datatypes in Isabelle/HOL - Animating a Many-Sorted Metatheory
Datatypes freely generated by their constructors are well supported in mainstream proof assistants. Algebraic specification languages offer more expressive datatypes on axiomatic means: nonfree datatypes generated from constructors modulo equations. We have implemented an Isabelle/HOL package for nonfree datatypes, without compromising foundations. The use of the package, and its nonfree iterat...
متن کاملResource Usage Protocols for Iterators
We discuss usage protocols for iterator objects that prevent concurrent modifications of the underlying collection while iterators are in progress. We formalize these protocols in Java-like object interfaces, enriched with separation logic contracts. We present examples of iterator clients and proofs that they adhere to the iterator protocol, as well as examples of iterator implementations and ...
متن کامل